package com.atguigu.yygh;

import com.atguigu.yygh.model.hosp.Hospital;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.mongodb.core.MongoTemplate;

/**
 * @author fenge
 */
@SpringBootTest
public class DateInsert {
    @Autowired
    private MongoTemplate mongoTemplate;

    @Test
    public void hospital(){
        Hospital hospital = new Hospital();
        hospital.setHoscode("1000_0");
        hospital.setHosname("北京协和医院");
        hospital.setHostype("1");
        hospital.setProvinceCode("110000");
        hospital.setCityCode("110100");
        hospital.setDistrictCode("110102");
        hospital.setAddress("大望路");
        hospital.setIntro("北京协和医院是集医疗、教学、科研于一体的大型三级甲等综合医院，是国家卫生计生委...目标而继续努力。");
        hospital.setRoute("东院区乘车路线：106、...更多乘车路线详见须知。");
        hospital.setLogoData("iVBORw0KGgoAAAA...NSUhEUg==");
        hospital.setBookingRule("{\"cycle\": 1,\"releaseTime\": \"08:30\",\"stopTime\": \"11:30\",\"quitDay\": -1,\"quitTime\": \"15:30\",\"rule\": [\"西院区预约号取号地点：西院区门诊楼一层大厅挂号窗口取号\",\"东院区预约号取号地点：东院区老门诊楼一层大厅挂号窗口或新门诊楼各楼层挂号/收费窗口取号\"]}");
        Hospital insert = mongoTemplate.insert(hospital);
        System.out.println(insert);
    }
}
/*
{
"hoscode": "1000_0",
"hosname": "北京协和医院",
"hostype": "1",
"provinceCode": "110000",
"cityCode": "110100",
"districtCode": "110102",
"address": "大望路",
"intro": "北京协和医院是集医疗、教学、科研于一体的大型三级甲等综合医院，是国家卫生计生委...目标而继续努力。",
"route": "东院区乘车路线：106、...更多乘车路线详见须知。",
"logoData": "iVBORw0KGgoAAAA...NSUhEUg==",
"bookingRule": {"cycle": "1","releaseTime": "08:30","stopTime": "11:30","quitDay": "-1","quitTime": "15:30","rule": ["西院区预约号取号地点：西院区门诊楼一层大厅挂号窗口取号","东院区预约号取号地点：东院区老门诊楼一层大厅挂号窗口或新门诊楼各楼层挂号/收费窗口取号"]}
}
 */